import Vue from 'vue'
import Router from 'vue-router'
import asyncLoad from './async-load'

Vue.use(Router)
const router = new Router({
  routes: [
    {
      path: '/',
      redirect: '/index'

    },
    {
      path: '/index',
      name: 'index',
      component: asyncLoad('view/Index.vue'),
      meta: {
        title: '首页',
        // auth:true
      }
    },
    {
      path: '/userInfo',
      name: 'userInfo',
      component: asyncLoad('view/buyer/UserInfo.vue'),
      meta: {
        title: '我的信息',
        auth:true
      }
    },
    {
      path: '/redpacket',
      name: 'redpacket',
      component: asyncLoad('view/redpacket'),
      meta: {
        title: '领红包',
        auth:true
      }
    },
    {
      path: '/lottery',
      name: 'lottery',
      component: asyncLoad('view/redpacket/lottery'),
      meta: {
        title: '抽奖',
        auth:true
      }
    },
    {
      path: '/rule',
      name: 'rule',
      component: asyncLoad('view/redpacket/rule'),
      meta: {
        title: '规则',
        auth:true
      }
    },
    {
      path: '/register',
      name: 'register',
      component: asyncLoad('view/Register.vue'),
      meta: {
        title: '注册'
      }
    },
    {
      path: '/login',
      name: 'login',
      component: asyncLoad('view/Login.vue'),
      meta: {
        title: '登录'
      }
    },
    {
      path: '/restPassword',
      name: 'restPassword',
      component: asyncLoad('view/ForgetPassword.vue'),
      meta: {
        title: '重置密码',
        // auth:true
      }
    },
    {
      path: '/bindId',
      name: 'bindId',
      component: asyncLoad('view/buyer/bindCode.vue'),
      meta: {
        title: '绑定身份证',
        auth:true
      }
    },
    {
      path: '/bindBank',
      name: 'bindBank',
      component: asyncLoad('view/buyer/bindBank.vue'),
      meta: {
        title: '绑定银行卡',
        auth:true
      }
    },
    {
      path: '/user',
      name: 'user',
      component: asyncLoad('view/buyer/User.vue'),
      meta: {
        title: '用户',
        auth:true
      }
    },
    {
      path: '/bindTB',
      name: 'bindTB',
      component: asyncLoad('view/buyer/BindTB.vue'),
      meta: {
        title: '淘宝账号绑定',
        auth:true
      }
    },
    {
      path: '/bindJD',
      name: 'bindJD',
      component: asyncLoad('view/buyer/BindJD.vue'),
      meta: {
        title: '京东账号绑定',
        auth:true
      }
    },
    {
      path: '/mission',
      name: 'mission',
      component: asyncLoad('view/buyer/Mission.vue'),
      meta: {
        title: '全部任务',
        auth:true
      }
    },
    {
      path: '/task',
      name: 'task',
      component: asyncLoad('view/buyer/TaoBaoMtask.vue'),
      meta: {
        title: '任务浏览',
        auth:true
      }
    },
    {
      path: '/orderDetails',
      name: 'orderDetails',
      component: asyncLoad('view/buyer/OrderDetails.vue'),

      meta: {
        title: '订单列表',
        auth:true
      }
    },
    {
      path: '/taskDetails/:id',
      name: 'taskDetails',
      component: asyncLoad('view/buyer/TaskDetails.vue'),

      meta: {
        title: '订单详情',
        auth:true
      }
    },
    {
      path: '/taskAcceptBrowse/:id',
      name: 'taskAcceptBrowse',
      component: asyncLoad('view/buyer/TaskLook.vue'),

      meta: {
        title: '订单详情',
        auth:true
      }
    },
    {
      path: '/attention',
      name: 'attention',
      component: asyncLoad('view/buyer/Attention.vue'),

      meta: {
        title: '注意事项',
        auth:true
      }
    },
    {
      path: '/taskOperation/:id',
      name: 'taskOperation',
      component: asyncLoad('view/buyer/TaskOperation.vue'),

      meta: {
        title: '注意事项',
        auth:true
      }
    },
    {
      path: '/myAccount',
      name: 'myAccount',
      component: asyncLoad('view/buyer/MyAccount.vue'),
      meta: {
        title: '我的账户',
        auth:true
      }
    },
    {
      path: '/withdrawDeposit',
      name: 'withdrawDeposit',
      component: asyncLoad('view/buyer/withdrawDeposit.vue'),
      meta: {
        title: '资金提现明细',
        auth:true
      }
    },
    {
      path: '/withdrawDepositFrom',
      name: 'wdFrom',
      component: asyncLoad('view/buyer/withdrawDepositFrom.vue'),
      meta: {
        title: '资金提现明细',
        auth:true
      }
    },
    {
      path: '/toMoney',
      name: 'toMoney',
      component: asyncLoad('view/buyer/ToMoney.vue'),
      meta: {
        title: '推广赚金',
        auth:true
      }
    },
    {
      path: '/userVip',
      name: 'userVip',
      component: asyncLoad('view/buyer/userVip.vue'),
      meta: {
        title: '我的VIP',
        auth:true
      }
    },
    {
      path: '/comment',
      name: 'comment',
      component: asyncLoad('view/buyer/Comments.vue'),
      meta: {
        title: '评论',
        auth:true
      }
    },
    {
      path: '/complaint',
      name: 'complaint',
      component: asyncLoad('view/buyer/Complaint.vue'),
      meta: {
        title: '投诉',
        auth:true
      }
    },
    {
      path: '/getstarted',
      name: 'getstarted',
      component: asyncLoad('view/GetStarted.vue'),
      meta: {
        title: '新手教学',
        auth:true
      }
    },
    {
      path: '/viewPicBind',
      name: 'viewPicBind',
      component: asyncLoad('view/ViewPicBind.vue'),
      meta: {
        title: '绑定淘宝示例图',
        auth:true
      }
    },

  ],
})


export default router
